import { lazy } from "react";
import { createBrowserRouter } from "react-router-dom";

const Home = lazy(() => import("../parge/Home/Home"));
const Login = lazy(() => import("../parge/Login/Login"));
const Index = lazy(() => import("../parge/Index/Index"));
const Detail = lazy(() => import('../parge/detail/detail'))

export const routerlist = [
  {
    path: "/index",
    element: <Index></Index>,
    title: "首页",
  },

];

const router = createBrowserRouter([
  {
    path: "/",
    element: <Home></Home>,
    children: routerlist,
  },
  {
    path: '/detail/:id',
    element: <Detail></Detail>,
    title: "详情页"
  },
  {
    path: "/login",
    element: <Login></Login>,
  },
]);

export default router;
